From 89d28eb09d98204c10c4924b2c0a81d86283d8fa Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 14 Jul 2010 16:03:51 +0200 Subject: [PATCH] API: remove gdk_draw_glyphs() and gdk_draw_glyphs_transformed() --- docs/reference/gdk/gdk3-sections.txt | 2 - docs/reference/gdk/tmpl/drawing.sgml | 27 ----- .../reference/gdk/tmpl/pango_interaction.sgml | 9 +- gdk/gdk.symbols | 2 - gdk/gdkdraw.c | 107 ------------------ gdk/gdkdrawable.h | 29 ----- gdk/gdkpixmap.c | 45 -------- gdk/gdkwindow.c | 79 ------------- 8 files changed, 4 insertions(+), 296 deletions(-) diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt index e9bd33ee9d..5963faeab1 100644 --- a/docs/reference/gdk/gdk3-sections.txt +++ b/docs/reference/gdk/gdk3-sections.txt @@ -342,8 +342,6 @@ gdk_draw_segments GdkSegment gdk_draw_rectangle gdk_draw_polygon -gdk_draw_glyphs -gdk_draw_glyphs_transformed gdk_draw_layout_line gdk_draw_layout_line_with_colors gdk_draw_layout diff --git a/docs/reference/gdk/tmpl/drawing.sgml b/docs/reference/gdk/tmpl/drawing.sgml index 3b7b4be55b..46f63f56dd 100644 --- a/docs/reference/gdk/tmpl/drawing.sgml +++ b/docs/reference/gdk/tmpl/drawing.sgml @@ -219,33 +219,6 @@ function. @n_points: - - - - - -@drawable: -@gc: -@font: -@x: -@y: -@glyphs: - - - - - - - -@drawable: -@gc: -@matrix: -@font: -@x: -@y: -@glyphs: - - diff --git a/docs/reference/gdk/tmpl/pango_interaction.sgml b/docs/reference/gdk/tmpl/pango_interaction.sgml index b9556a9b7f..82e4c3085a 100644 --- a/docs/reference/gdk/tmpl/pango_interaction.sgml +++ b/docs/reference/gdk/tmpl/pango_interaction.sgml @@ -25,11 +25,10 @@ linkend="PANGO-SCALE-CAPS">PANGO_SCALE or the PANGO_PIXELS() macro.) Rendering a Pango layout is done most simply with gdk_draw_layout(); -you can also draw pieces of the layout with gdk_draw_layout() or -gdk_draw_glyphs(). #GdkPangoRenderer is a subclass of #PangoRenderer -that is used internally to implement these functions. Using it -directly or subclassing it can be useful in some cases. See the -#GdkPangoRenderer documentation for details. +you can also draw pieces of the layout with gdk_draw_layout(). +#GdkPangoRenderer is a subclass of #PangoRenderer that is used internally +to implement these functions. Using it directly or subclassing it can be +useful in some cases. See the #GdkPangoRenderer documentation for details. Using #GdkPangoRenderer to draw transformed text diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols index be739e71b3..f62bf7f151 100644 --- a/gdk/gdk.symbols +++ b/gdk/gdk.symbols @@ -550,8 +550,6 @@ gdk_drawable_get_visible_region gdk_drawable_get_visual gdk_drawable_set_colormap gdk_draw_drawable -gdk_draw_glyphs -gdk_draw_glyphs_transformed gdk_draw_line gdk_draw_lines gdk_draw_point diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c index 933cc94527..0a8532c54d 100644 --- a/gdk/gdkdraw.c +++ b/gdk/gdkdraw.c @@ -530,113 +530,6 @@ gdk_draw_lines (GdkDrawable *drawable, (GdkPoint *) points, n_points); } -static void -real_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - const PangoMatrix *matrix, - PangoFont *font, - gdouble x, - gdouble y, - PangoGlyphString *glyphs) -{ - cairo_t *cr; - - cr = gdk_cairo_create (drawable); - _gdk_gc_update_context (gc, cr, NULL, NULL, TRUE, drawable); - - if (matrix) - { - cairo_matrix_t cairo_matrix; - - cairo_matrix.xx = matrix->xx; - cairo_matrix.yx = matrix->yx; - cairo_matrix.xy = matrix->xy; - cairo_matrix.yy = matrix->yy; - cairo_matrix.x0 = matrix->x0; - cairo_matrix.y0 = matrix->y0; - - cairo_set_matrix (cr, &cairo_matrix); - } - - cairo_move_to (cr, x, y); - pango_cairo_show_glyph_string (cr, font, glyphs); - - cairo_destroy (cr); -} - -/** - * gdk_draw_glyphs: - * @drawable: a #GdkDrawable - * @gc: a #GdkGC - * @font: font to be used - * @x: X coordinate of baseline origin - * @y: Y coordinate of baseline origin - * @glyphs: the glyph string to draw - * - * This is a low-level function; 99% of text rendering should be done - * using gdk_draw_layout() instead. - * - * A glyph is a single image in a font. This function draws a sequence of - * glyphs. To obtain a sequence of glyphs you have to understand a - * lot about internationalized text handling, which you don't want to - * understand; thus, use gdk_draw_layout() instead of this function, - * gdk_draw_layout() handles the details. - * - **/ -void -gdk_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs) -{ - g_return_if_fail (GDK_IS_DRAWABLE (drawable)); - g_return_if_fail (GDK_IS_GC (gc)); - - real_draw_glyphs (drawable, gc, NULL, font, - x, y, glyphs); -} - -/** - * gdk_draw_glyphs_transformed: - * @drawable: a #GdkDrawable - * @gc: a #GdkGC - * @matrix: (allow-none): a #PangoMatrix, or %NULL to use an identity transformation - * @font: the font in which to draw the string - * @x: the x position of the start of the string (in Pango - * units in user space coordinates) - * @y: the y position of the baseline (in Pango units - * in user space coordinates) - * @glyphs: the glyph string to draw - * - * Renders a #PangoGlyphString onto a drawable, possibly - * transforming the layed-out coordinates through a transformation - * matrix. Note that the transformation matrix for @font is not - * changed, so to produce correct rendering results, the @font - * must have been loaded using a #PangoContext with an identical - * transformation matrix to that passed in to this function. - * - * See also gdk_draw_glyphs(), gdk_draw_layout(). - * - * Since: 2.6 - **/ -void -gdk_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - const PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs) -{ - g_return_if_fail (GDK_IS_DRAWABLE (drawable)); - g_return_if_fail (GDK_IS_GC (gc)); - - real_draw_glyphs (drawable, gc, matrix, font, - x / PANGO_SCALE, y / PANGO_SCALE, glyphs); -} - static GdkDrawable * gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable, gint x, diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h index 5a94f84842..93d61c3e62 100644 --- a/gdk/gdkdrawable.h +++ b/gdk/gdkdrawable.h @@ -94,13 +94,6 @@ struct _GdkDrawableClass GdkPoint *points, gint npoints); - void (*draw_glyphs) (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); - gint (*get_depth) (GdkDrawable *drawable); void (*get_size) (GdkDrawable *drawable, gint *width, @@ -124,14 +117,6 @@ struct _GdkDrawableClass gint *composite_x_offset, gint *composite_y_offset); - void (*draw_glyphs_transformed) (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); - cairo_surface_t *(*ref_cairo_surface) (GdkDrawable *drawable); GdkDrawable *(*get_source_drawable) (GdkDrawable *drawable); @@ -226,12 +211,6 @@ void gdk_draw_lines (GdkDrawable *drawable, const GdkPoint *points, gint n_points); -void gdk_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); void gdk_draw_layout_line (GdkDrawable *drawable, GdkGC *gc, gint x, @@ -258,14 +237,6 @@ void gdk_draw_layout_with_colors (GdkDrawable *drawable, const GdkColor *foreground, const GdkColor *background); -void gdk_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - const PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); - cairo_region_t *gdk_drawable_get_clip_region (GdkDrawable *drawable); cairo_region_t *gdk_drawable_get_visible_region (GdkDrawable *drawable); diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c index dd4eb1266c..6915cd7ee2 100644 --- a/gdk/gdkpixmap.c +++ b/gdk/gdkpixmap.c @@ -69,20 +69,6 @@ static void gdk_pixmap_draw_lines (GdkDrawable *drawable, GdkPoint *points, gint npoints); -static void gdk_pixmap_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); -static void gdk_pixmap_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); - static void gdk_pixmap_real_get_size (GdkDrawable *drawable, gint *width, gint *height); @@ -146,8 +132,6 @@ gdk_pixmap_class_init (GdkPixmapObjectClass *klass) drawable_class->draw_points = gdk_pixmap_draw_points; drawable_class->draw_segments = gdk_pixmap_draw_segments; drawable_class->draw_lines = gdk_pixmap_draw_lines; - drawable_class->draw_glyphs = gdk_pixmap_draw_glyphs; - drawable_class->draw_glyphs_transformed = gdk_pixmap_draw_glyphs_transformed; drawable_class->get_depth = gdk_pixmap_real_get_depth; drawable_class->get_screen = gdk_pixmap_real_get_screen; drawable_class->get_size = gdk_pixmap_real_get_size; @@ -315,35 +299,6 @@ gdk_pixmap_draw_lines (GdkDrawable *drawable, gdk_draw_lines (private->impl, gc, points, npoints); } -static void -gdk_pixmap_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs) -{ - GdkPixmapObject *private = (GdkPixmapObject *)drawable; - - _gdk_gc_remove_drawable_clip (gc); - gdk_draw_glyphs (private->impl, gc, font, x, y, glyphs); -} - -static void -gdk_pixmap_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs) -{ - GdkPixmapObject *private = (GdkPixmapObject *)drawable; - - _gdk_gc_remove_drawable_clip (gc); - gdk_draw_glyphs_transformed (private->impl, gc, matrix, font, x, y, glyphs); -} - static void gdk_pixmap_real_get_size (GdkDrawable *drawable, gint *width, diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index e636193429..5be5f91c09 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -264,20 +264,6 @@ static void gdk_window_draw_lines (GdkDrawable *drawable, GdkPoint *points, gint npoints); -static void gdk_window_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); -static void gdk_window_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs); - static cairo_surface_t *gdk_window_ref_cairo_surface (GdkDrawable *drawable); static cairo_surface_t *gdk_window_create_cairo_surface (GdkDrawable *drawable, int width, @@ -461,8 +447,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass) drawable_class->draw_points = gdk_window_draw_points; drawable_class->draw_segments = gdk_window_draw_segments; drawable_class->draw_lines = gdk_window_draw_lines; - drawable_class->draw_glyphs = gdk_window_draw_glyphs; - drawable_class->draw_glyphs_transformed = gdk_window_draw_glyphs_transformed; drawable_class->get_depth = gdk_window_real_get_depth; drawable_class->get_screen = gdk_window_real_get_screen; drawable_class->get_size = gdk_window_real_get_size; @@ -4369,69 +4353,6 @@ gdk_window_draw_lines (GdkDrawable *drawable, END_DRAW; } -static void -gdk_window_draw_glyphs (GdkDrawable *drawable, - GdkGC *gc, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs) -{ - if (GDK_WINDOW_DESTROYED (drawable)) - return; - - BEGIN_DRAW; - gdk_draw_glyphs (impl, gc, font, - x - x_offset, y - y_offset, glyphs); - END_DRAW; -} - -static void -gdk_window_draw_glyphs_transformed (GdkDrawable *drawable, - GdkGC *gc, - PangoMatrix *matrix, - PangoFont *font, - gint x, - gint y, - PangoGlyphString *glyphs) -{ - PangoMatrix tmp_matrix; - - if (GDK_WINDOW_DESTROYED (drawable)) - return; - - BEGIN_DRAW; - - if (x_offset != 0 || y_offset != 0) - { - if (matrix) - { - tmp_matrix = *matrix; - tmp_matrix.x0 -= x_offset; - tmp_matrix.y0 -= y_offset; - matrix = &tmp_matrix; - } - else if (GDK_PANGO_UNITS_OVERFLOWS (x_offset, y_offset)) - { - PangoMatrix identity = PANGO_MATRIX_INIT; - - tmp_matrix = identity; - tmp_matrix.x0 -= x_offset; - tmp_matrix.y0 -= y_offset; - matrix = &tmp_matrix; - } - else - { - x -= x_offset * PANGO_SCALE; - y -= y_offset * PANGO_SCALE; - } - } - - gdk_draw_glyphs_transformed (impl, gc, matrix, font, x, y, glyphs); - - END_DRAW; -} - static cairo_t * setup_backing_rect (GdkWindow *window, GdkWindowPaint *paint, int x_offset_cairo, int y_offset_cairo) { -- 2.30.2